#ifndef KCF_TRACKER_HPP
#define KCF_TRACKER_HPP

#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include "base_tracker.hpp"

class KcfTracker : public BaseTracker
{
public:
    cv::Mat mOriginGrayImg;
    cv::Mat mGrayImg;

    KcfTracker()
    {
        mTracker = cv::TrackerKCF::create();
    }

    ~KcfTracker() {}

    virtual int init(cv::Mat &img, cv::Rect2d &rect)
    {
        mTracker->init(img, rect);
        mOriginBgrImg = img.clone();
        mOriginRect2d = rect;
        return 0;
    }

    virtual bool update(cv::Mat &img, cv::Rect2d &rect)
    {
        bool result = mTracker->update(img, rect);
        return result;
    }

private:
    cv::Ptr<cv::Tracker> mTracker;
};

#endif